<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>考神驾到手机站我的成绩</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
    <link rel="stylesheet" type="text/css" href="css/public.css">
    <script type="text/javascript" src="js/jquery.min.js"></script>
    <script type="text/javascript" src="js/windowsheight.js"></script>

    <script src="${pageContext.request.contextPath}/manager_page/layui/layui.js"></script>

    <script src="${pageContext.request.contextPath}/highchart/code/highcharts.js"></script>
    <script src="${pageContext.request.contextPath}/highchart/code/highcharts-3d.js"></script>
    <%--    <script src="${pageContext.request.contextPath}/highchart/code/modules/exporting.js"></script>--%>
    <%--    <script src="${pageContext.request.contextPath}/highchart/code/modules/export-data.js"></script>--%>
    <%--    <script src="${pageContext.request.contextPath}/highchart/code/modules/accessibility.js"></script>--%>
</head>

<body>
<!-----------头部开始--------------->
<%@ include file="page_head.jsp"%>
<!-----------头部结束--------------->
<!-----------内容开始--------------->
<div class="content">

    <div class="newdetailcon">
        <div class="biaoti"><img src="images/libg_06.jpg"><span id="tongji_class">科一成绩统计</span></div>
    </div>

    <%--  <div class="tongimg" >--%>
    <%--&lt;%&ndash;    <img src="images/tuoyuan_03.jpg"/>&ndash;%&gt;--%>
    <%--      --%>

    <%--  </div>--%>
    <div id="container" style="width: 100%;height: 80%;"></div>

    <div class="testtitle">
        <div class="biaoti"><img src="images/libg_06.jpg"><p class="donepre">您累计考试 <b id="test_times">0</b> 次</p></div>
        <div class="biaoti"><img src="images/libg_06.jpg"><p class="rightpre">其中通过<b id="pass_times">0</b> 次，没通过<b id="fail_times">0</b>次</p></div>
        <div class="biaoti"><img src="images/libg_06.jpg"><p class="errorpre">您的通过率为<b id="pass_times_percent">0</b>%</p></div>
    </div>

    <div class="pageturn">
        <div class="prepage"><a href="javascript:lastPage();">&lt; 上一页</a></div>
        <p><span><b id="current_page">1</b>/2</span></p>
        <div class="prepage"> <a href="javascript:nextPage();">下一页 &gt;</a></div>
    </div>

</div>
<!-----------内容结束--------------->
<%-- <div class="footer">--%>
<%--   <p>©考神驾到版权所有</p>--%>
<%--   <span>www.kaoshenjiadao.com</span>--%>
<%-- </div>--%>

</body>

<script>
    var layer;
    layui.use('layer',function(){
        layer=layui.layer;
    })
    var json={};

    $("#page_head_title").text("考试成绩统计");

    window.onload=function(){
        initTongji_img("科一");
    }


    function lastPage(){
        var current_page=parseInt($("#current_page").text());
        if(current_page<=1){
            layer.msg("这已经是第一页了")
        }else{
            current_page--;
            $("#current_page").text(current_page);
            $("#tongji_class").text("科一成绩统计");
            initTongji_img("科一");
        }
    }

    function nextPage(){
        var current_page=parseInt($("#current_page").text());
        if(current_page>=2){
            layer.msg("这已经是最后一页了")
        }else{
            current_page++;
            $("#current_page").text(current_page);
            $("#tongji_class").text("科四成绩统计");
            initTongji_img("科四");
        }
    }

    function initTongji_img(question_class){
        $.ajax({
            url:"${pageContext.request.contextPath}/front_test_real/init_test_tongji.do",
            data:{
                "question_class":question_class
            },
            success:function (data,status){
                if(status=="success"){
                    //初始化统计图
                    var chart={
                        zoomType:'xy'
                    };
                    var title = {
                        text: ''
                    };
                    var xAxis = {
                        categories: ['+1次考试', '+2次考试', '+3次考试', '+4次考试', '+5次考试', '+6次考试',
                            '+7次考试', '+8次考试', '+9次考试', '+10次考试', '+11次考试', '+12次考试']
                    };
                    var yAxis = {
                        title: {
                            text: '成绩 (分)'
                        }
                    };
                    var plotOptions = {
                        line: {
                            dataLabels: {
                                enabled: true
                            },
                            enableMouseTracking: true
                        }
                    };
                    // var series= [{
                    //     name: '0起',
                    //     data: [7.0, 6.9, 9.5, 14.5, 18.4, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6]
                    // }, {
                    //     name: '12起',
                    //     data: [3.9, 4.2, 5.7, 8.5, 11.9, 15.2, 17.0, 16.6, 14.2, 10.3, 6.6, 4.8]
                    // }
                    // ];
                    var series=[];
                    var retimes=Math.ceil(data.test_times/12);
                    var yutimes=data.test_times%12;
                    for(var i=1;i<retimes;i++){
                        var test_tool={};
                        var chengshu=(i-1)*12;
                        test_tool.name=chengshu+"起";
                        test_tool.data=[];
                        for(var j=0;j<12;j++){
                            test_tool.data.push(data.testList[j+chengshu].grade);
                        }
                        series.push(test_tool);
                    }
                    retimes--;
                    retimes*=12;
                    var test_tool_end={};
                    test_tool_end.name=retimes+"起"
                    if(data.test_times==0)
                        test_tool_end.name="0起";
                    test_tool_end.data=[];
                    for(var i=0;i<yutimes;i++){
                        test_tool_end.data.push(data.testList[i+retimes].grade);
                    }
                    series.push(test_tool_end);

                    var json = {};

                    json.chart=chart;
                    json.title = title;
                    json.xAxis = xAxis;
                    json.yAxis = yAxis;
                    json.series = series;
                    json.plotOptions = plotOptions;
                    $('#container').highcharts(json);


                    $("#test_times").text(data.test_times);
                    $("#pass_times").text(data.pass_times);
                    $("#fail_times").text(data.fail_times);
                    $("#pass_times_percent").text(data.pass_percent);

                }
            }
        })

    }




</script>


<script>

    // json.chart = chart;
    // json.title = title;
    // json.tooltip = tooltip;
    // json.series = series;
    // json.plotOptions = plotOptions;
    // json.accessibility=accessibility;
    // $('#container').highcharts(json);
    //
    //
    // function changePercent(percent1,percent2){
    //
    //     var right={};
    //     var error={};
    //     var untest={};
    //
    //     right.name="做对";
    //     right.y=percent1;
    //     right.sliced=true;
    //     right.selected=true;
    //
    //     error.name="做错";
    //     error.y=percent2;
    //
    //     untest.name="未做";
    //     untest.y=100-right.y-error.y;
    //
    //     var data_tool=[];
    //     data_tool.push(right);
    //     data_tool.push(error);
    //     data_tool.push(untest);
    //
    //     json.series=[{
    //         type: 'pie',
    //         name: '科一试题统计',
    //         data: data_tool
    //     }]
    //
    //     $('#container').highcharts(json);
    // }

</script>




<!--头部高度赋给列表的topjs-->
<script>
    var heighttop=$(".top").height();
    $(".topmenu").css("top",heighttop);
    $(".menumore").toggle(function(){
        $(".topmenu").show();
    },function(){
        $(".topmenu").hide();
    })
    $(".buttontop").click(function(){
        $(".topmenu").hide();
    })

    $(function(){
        $(".tasecartop span a").click(function(){
            var $banktip=$(this).attr("tip");
            $($banktip).show().siblings().hide();
            $(".tasecartop span a").removeClass("payaclik");
            $(this).addClass("payaclik");
        })

    })
    /*模拟考试列表分类车型选择tab切换*/
    $(function(){
        $(".test_onelist li a").click(function(){
            var $banktip=$(this).attr("tip");
            $($banktip).show().siblings().hide();
            $(".test_onelist li a").removeClass("testcaraclick");
            $(this).addClass("testcaraclick");
        })

    })

</script>

<!--头部高度赋给列表的topjs-->
<!--banner将图片的高度赋给父级扪js-->
<script>
    var heighta=$("#incltialiu li:eq(0) img").height();
    $(".main,.width,#incltialiu").height(heighta) ;
</script>
<!--banner将图片的高度赋给父级扪js-->
<!--首页标题点击出现更多分类js-->
<script>
    $(".titlemore").toggle(function(){
        $(this).parent(".tabtila").siblings(".moresort").show()
        $(this).children("img").attr("src","images/title_692.jpg")
    },function(){
        $(this).parent(".tabtila").siblings(".moresort").hide()
        $(this).children("img").attr("src","images/title_69.jpg")
    })
</script>
<!--首页标题点击出现更多分类js-->
</html>
